home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
WINPROGS
/
UPC12BS1.ZIP
/
UUCICO
/
DCPSYS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-03
|
37KB
|
1,024 lines
/*--------------------------------------------------------------------*/
/* d c p s y s . c */
/* */
/* System support functions for UUCICO */
/* */
/* Changes Copyright (c) 1990-1993 by Kendra Electronic */
/* Wonderworks. */
/* */
/* Changes Copyright (c) 1989 by Andrew H. Derbyshire. */
/* */
/* All rights reserved except those explicitly granted by the */
/* UUPC/extended license agreement. */
/* */
/* Copyright (c) Richard H. Lamb 1985, 1986, 1987 */
/* Changes Copyright (c) Stuart Lynne 1987 */
/* */
/* Updated: */
/* */
/* 13May89 - Modified checkname to only examine first token of */
/* name. */
/* Modified rmsg to initialize input character before */
/* use. */
/* 16May89 - Moved checkname to router.c - ahd */
/* 17May89 - Wrote real checktime() - ahd */
/* 17May89 - Changed getsystem to return 'I' instead of 'G' */
/* 25Jun89 - Added Reach-Out America to keyword table for */
/* checktime */
/* 22Sep89 - Password file support for hosts */
/* 25Sep89 - Change 'ExpectStr' message to debuglevel 2 */
/* 01Jan90 - Revert 'ExpectStr' message to debuglevel 1 */
/* 28Jan90 - Alter callup() to use table driven modem driver. */
/* Add direct(), qx() procedures. */
/* 8 Jul90 - Add John DuBois's expectstr() routine to fix */
/* problems with long input buffers. */
/* 11Nov90 - Delete QX support, add ddelay, ssleep calls */
/* 21Sep92 - Insure system system name and time do not crash */
/* UUCICO - from the original fix by Eugene */
/* Nesterenko, Moscow, Russia */
/*--------------------------------------------------------------------*/
/*
* $Id: dcpsys.c 1.24 1993/10/03 22:34:33 ahd Exp $
*
* $Log: dcpsys.c $
* Revision 1.24 1993/10/03 22:34:33 ahd
* Alter format of numbers printed
*
* Revision 1.23 1993/09/29 04:52:03 ahd
* Use additional state in support of suspend port code
*
* Revision 1.22 1993/09/28 01:38:19 ahd
* Add configurable timeout for conversation start up phase
*
* Revision 1.21 1993/09/27 04:04:06 ahd
* Normalize references to modem speed to avoid incorrect displays
*
* Revision 1.20 1993/09/27 00:48:43 ahd
* Allow 't' protocol under 16 bit OS/2
*
* Revision 1.19 1993/09/21 01:42:13 ahd
* Move declare of protocol list into source from header
*
* Revision 1.18 1993/09/20 04:48:25 ahd
* TCP/IP support from Dave Watt
* 't' protocol support
* OS/2 2.x support (BC++ 1.0 for OS/2)
*
* Revision 1.17 1993/08/26 05:00:25 ahd
* Debugging code for odd failures on J. McBride's network
*
* Revision 1.16 1993/05/30 00:01:47 ahd
* Multiple commuications drivers support
*
* Revision 1.15 1993/05/09 03:41:47 ahd
* Make wmsg accept const string
* Make sending/receiving of -x string to/from remote UUCICO optional
* Delete rejection of high levels of debug for anonymous UUCICO's
*
* Revision 1.14 1993/05/06 03:41:48 ahd
* Save true host name of caller in hostp->via field for use by
* SYSLOG processing.
*
* Revision 1.13 1993/04/11 00:34:11 ahd
* Global edits for year, TEXT, etc.
*
* Revision 1.12 1993/04/05 04:35:40 ahd
* Add timestamp, file size to directory information
*
* Revision 1.11 1993/01/23 19:08:09 ahd
* Don't update system stats in sysend()
*
* Revision 1.10 1992/12/11 12:45:11 ahd
* Shorten remote display to improve OS/2 windowed scrolling
*
* Revision 1.9 1992/12/01 04:37:03 ahd
* Modify *nbstime call restrictions to make it less agressive
*
* Revision 1.8 1992/11/22 21:20:45 ahd
* Use strpool for const string allocation
*
* Revision 1.7 1992/11/21 06:17:08 ahd
* Transmit only one character in response to P (protocol) request
*
* Revision 1.6 1992/11/19 03:00:51 ahd
* drop rcsid
*
* Revision 1.5 1992/11/18 03:49:21 ahd
* Move check of call window to avoid premature lock file overhead
*
* Revision 1.4 1992/11/17 13:46:42 ahd
* If host lookup fails, issue real error message, not malloc failure!
*
* Revision 1.3 1992/11/16 02:14:17 ahd
* Initialize previous directory scanned variable in scandir
*
* Revision 1.2 1992/11/15 20:11:07 ahd
* Clean up modem file support for different protocols
*
*/
/*--------------------------------------------------------------------*/
/* system include files */
/*--------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
/*--------------------------------------------------------------------*/
/* UUPC/extended include files */
/*--------------------------------------------------------------------*/
#include "lib.h"
#include "arpadate.h"
#include "checktim.h"
#include "dcp.h"
#include "dcpfpkt.h"
#include "dcpgpkt.h"
#include "dcptpkt.h"
#include "dcplib.h"
#include "dcpsys.h"
#include "export.h"
#include "hlib.h"
#include "hostable.h"
#include "hostatus.h"
#include "modem.h"
#include "lock.h"
#include "nbstime.h"
#include "uundir.h"
#include "ssleep.h"
#include "security.h"
#include "commlib.h"
currentfile();
/*--------------------------------------------------------------------*/
/* Define available protocols */
/*--------------------------------------------------------------------*/
typedef struct {
char type;
procref getpkt, sendpkt, openpk, closepk, rdmsg, wrmsg, eofpkt,
filepkt;
boolean network;
} Proto;
Proto Protolst[] = {
{ 'g', ggetpkt, gsendpkt, gopenpk, gclosepk,
grdmsg, gwrmsg, geofpkt, gfilepkt,
FALSE,
} ,
{ 'G', ggetpkt, gsendpkt, Gopenpk, gclosepk,
grdmsg, gwrmsg, geofpkt, gfilepkt,
FALSE,
} ,
{ 'f', fgetpkt, fsendpkt, fopenpk, fclosepk,
frdmsg, fwrmsg, feofpkt, ffilepkt,
FALSE,
} ,
{ 'v', ggetpkt, gsendpkt, vopenpk, gclosepk,
grdmsg, gwrmsg, geofpkt, gfilepkt,
FALSE,
} ,
#if defined(_Windows) || defined(BIT32ENV) || defined(FAMILYAPI)
{ 't', tgetpkt, tsendpkt, topenpk, tclosepk,
grdmsg, gwrmsg, geofpkt, gfilepkt, // Yup, same as 'g'
TRUE,
} ,
#endif
{ '\0' }
};
procref getpkt, sendpkt, openpk, closepk, rdmsg, wrmsg, eofpkt, filepkt;
char *flds[60];
int kflds;
static char protocols[5];
static char S_sysline[BUFSIZ];
static void setproto(char wanted);
static char HostGrade( const char *fname, const char *remote );
/****************************************/
/* Sub Systems */
/****************************************/
/*-----------